cmdshell.dirs = {
	'.':[//array means folder
		'readme.txt'
	]
}

cmdshell.cmd.ls = {
	help : 'list files and folders',
	run : function(res){
		cmdshell.debuger('[CMD] LS is running');
		
		var arr = res.split(" "), list='';
		
		if(!arr[1]){
			$.each(cmdshell.dirs['.'], function(i,v){
				list+=v+' ';
			})
			return list;
		}else{
			if(arr[1]=="-l"){
				
				$.each(cmdshell.dirs['.'], function(i,v){
					list+='-rwxr--r-- 1 crisboot crisboot     236 2011-04-29 02:19 '+v+'\n';
				})
				return list;
			}else if(arr[1]=="-a"){
				list += ". .. ";

				$.each(cmdshell.dirs['.'], function(i,v){
					list+=v+'    ';
				})
				return list;
			}else{
				return 'try ls -a or ls -l';			
			}
		}
	}
}

